import unittest
from UIAutoTest.day03.count_02 import count

# 单元测试
class countTest(unittest.TestCase):
    # 测试加法
    def test_add(self):
        # 实例化对象
        c = count(4, 5)
        a = c.add()
        self.assertTrue(a, 9)

    def test_cheng(self):
        # 实例化对象
        c1 = count(1, 5)
        r = c1.cheng()
        self.assertTrue(r, msg="不对！！！")

    def test_fun2(self):
        names = ["李四", "王五", "赵六", "刘七", "懂八"]
        obj = count(7, 8)
        randomObj = obj.fun2()
        print(randomObj)
        # 随机值是否在names中  如果在  就测试成功
        self.assertIn(randomObj, names)
        # 如果随机值不在names中 就测试成功
        # self.assertNotIn(randomObj,names)
